package cn.sdormitory.service.impl;

import cn.sdormitory.service.AppSyssetSmsTemplateService;
import cn.sdormitory.sysset.dao.SyssetSmsTemplateDao;
import cn.sdormitory.sysset.entity.SyssetSmsTemplate;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * @创建人：zhouyang
 * @创建时间：2021/1/6 15:04
 * @version：V1.0
 */
@Slf4j
@Service
public class AppSyssetSmsTemplateServiceImpl extends ServiceImpl<SyssetSmsTemplateDao, SyssetSmsTemplate> implements AppSyssetSmsTemplateService {
    @Override
    public SyssetSmsTemplate getSyssetSmsTemplateById(Long id) {
        return getById(id);
    }

    @Override
    public SyssetSmsTemplate getBySmsTitle(String smsTitle) {
        return this.baseMapper.selectOne(new LambdaQueryWrapper<SyssetSmsTemplate>().eq(SyssetSmsTemplate::getSmsTitle, smsTitle));
    }

    @Override
    public SyssetSmsTemplate getBySmsTypee(int smsType) {
        return this.baseMapper.selectOne(new LambdaQueryWrapper<SyssetSmsTemplate>().eq(SyssetSmsTemplate::getSmsType, smsType));
    }
}
